<!DOCTYPE html>
<html lang="en">
<head>
	<include data="../head.html">
	<title>友情链接</title> 
	<style>
	h4{white-space: normal;}
	#link-list-div{min-height: 20px;}
	.link-logo{max-width: 48px; max-height: 48px;}
	</style>
</head>
<body data-menu="modules">
	<div class="container">
		<ul class="nav nav-tabs" role="tablist">
			<li role="presentation" class="active">
				<a href="#">所有链接({admin_count_records('link')})</a>
			</li>
		</ul>
		<div id="link-list-div">
			<while data="get_multi_link(array('limit'=>0))">
				<div class="media" data-id="{link_id()}">
					<div class="media-left">
						<div class="media-logo">
							<if data="link_logo()">
								<img src="{link_logo()}" alt="链接 LOGO"/>
								<else>
									<i class="glyphicon glyphicon-link media-icon"></i>
								</else>
							</if>
						</div>
					</div>
					<div class="media-body">
						<h4 class="media-heading">
							{link_title()}
						</h4>
						<p class="media-content">
							<a href="{link_url()}" title="点击访问" target="_blank">{link_url()}</a>
						</p>
						<p class="media-meta">
							{link_desc()}
						</p>
					</div>
				</div>
			</while>
		</div>
		<div class="modal fade" id="link-modal">
			<div class="modal-dialog">
				<form action="{site_url()}mod.php?link::add" method="post">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
							<h4 class="modal-title">添加链接</h4>
						</div>
						<div class="modal-body">
							<div class="form-group">
								<label for="link_title">链接名称</label>
								<input type="text" class="form-control" name="link_title" id="link_title" required placeholder="友情链接的网站名称">
							</div>
							<div class="form-group">
								<label for="link_url">URL 地址</label>
								<input type="text" class="form-control" name="link_url" id="link_url" required placeholder="网站 URL 地址">
							</div>
							<div class="form-group">
								<label for="link_desc">描述</label>
								<textarea name="link_desc" id="link_desc" rows="2" class="form-control" placeholder="简单地介绍这个网站"></textarea>
							</div>
							<div class="form-group" id="set-logo">
								<label for="select-logo">设置 LOGO</label>
								<div>
									<img class="link-logo" id="link-logo" src="" data-origin="">
									<input type="hidden" id="link_logo" name="link_logo" value="">
									<button type="button" class="btn btn-success" id="select-logo" data-loading-text="正在上传...">上传图片</button>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="submit" class="btn btn-success">提交</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<include data="../foot.html">
</body>
</html>